package it.prova.elementedit;

import it.prova.MyVariable;

import org.eclipse.jst.pagedesigner.itemcreation.CreationData;
import org.eclipse.jst.pagedesigner.itemcreation.command.ElementCustomizationCommand;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.w3c.dom.Element;

@SuppressWarnings("restriction")
public class MyElementCustomizationCommand extends ElementCustomizationCommand
{
	private CreationData creationData;
	
	private Element tagElement;
	
//	private IDOMModel model;
		
	public MyElementCustomizationCommand
	(
		IDOMModel model, 
		Element tagElement, 
		CreationData creationData
	)
	{
		super(model, tagElement, creationData);
		
//		this.model = model;
		this.tagElement = tagElement;
		this.creationData = creationData;
	}
	
	@Override
	public void execute()
	{
		super.execute();
	}

	@Override
	protected boolean prepare()
	{
		return super.prepare();
	}

	@Override
	protected void applyChildElementCustomization()
	{
		super.applyChildElementCustomization();
	}

	@Override
	protected void applyAttributeCustomization()
	{
		MyVariable customData = (MyVariable) creationData.getDropCustomizationData();
		
		tagElement.setAttribute(customData.getName(), customData.getValue());
	}
}